﻿using AiXiu.Model;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace AiXiu.IDAL
{
    public interface IUserDAL
    {
        /// <summary>
        /// 添加用户信息
        /// </summary>
        /// <param name="logins"></param>
        /// <returns></returns>
        int AddUser(TBLogins logins);

        /// <summary>
        /// 判断用户名是否存在
        /// </summary>
        /// <param name="userName"></param>
        /// <returns></returns>
        bool ExistUserName(string userName);

        /// <summary>
        /// 判断手机号是否存在
        /// </summary>
        /// <param name="userName"></param>
        /// <returns></returns>
        bool ExistMobileNumber(string mobileNumber);

        /// <summary>
        /// 通过用户名查找登录信息
        /// </summary>
        /// <param name="userName"></param>
        /// <returns></returns>
        TBLogins FindByUserName(string userName);

        /// <summary>
        /// 通过用户id查找用户详细信息
        /// </summary>
        /// <param name="userId"></param>
        /// <returns></returns>
        TBUsers FindByUserId(int userId);

        /// <summary>
        /// 通过手机号查找用户信息
        /// </summary>
        /// <param name="userName">手机号</param>
        /// <returns></returns>
        TBLogins FindByMobile(string mobile);

        /// <summary>
        /// 更新用户信息(不包含头像)
        /// </summary>
        /// <param name="user"></param>
        /// <returns></returns>
        TBUsers EditUser(TBUsers user);

        /// <summary>
        /// 更新用户头像
        /// </summary>
        /// <param name="user"></param>
        /// <returns></returns>
        TBUsers EditAvatar(TBUsers user);
    }
}
